﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace DBSourceToolsLib.FileComparer
{
    public class DCDirectory : DCFile
    {
        public DCDirectory(string strDirectoryName, string strBaseDirectory, DirectoryList oDirectoryComparer)
            : base (strDirectoryName, strBaseDirectory, oDirectoryComparer)
        {
            System.IO.DirectoryInfo oDirInfo = new System.IO.DirectoryInfo(strDirectoryName);
            foreach (System.IO.FileInfo oFileInfo in oDirInfo.GetFiles())
            {
                Add(new DCFile(oFileInfo.FullName, strBaseDirectory, oDirectoryComparer));
            }
            foreach (System.IO.DirectoryInfo oDir in oDirInfo.GetDirectories())
            {
                Add(new DCDirectory(oDir.FullName, strBaseDirectory, oDirectoryComparer));
            }
        }

        public override void Add(IDCFileObject oDCFileObject)
        {
            this.m_FileList.Add(oDCFileObject);
        }


    }
}
